package com.mao.model.voucher;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.struts2.json.annotations.JSON;

/**
 * 中间表 采购入库单中的商品信息
 */
@Entity
@Table(name = "MAO_PRODUCT_WAREHOUSEVOUCHER")
@org.hibernate.annotations.Entity(dynamicInsert = true, dynamicUpdate = true)
public class ProductWareHouseVoucher extends ProductVoucherBase {

	private static final long serialVersionUID = 1L;

	private WareHouseVoucher voucher;

	@EmbeddedId
	@ManyToOne(optional = true, fetch = FetchType.LAZY)
	@JoinColumn(name = "WAREHOUSEVOUCHER", nullable = false, columnDefinition = "int")
	@JSON(serialize = false)
	public WareHouseVoucher getVoucher() {
		return voucher;
	}

	public void setVoucher(WareHouseVoucher voucher) {
		this.voucher = voucher;
	}

}
